package config

import (
	"os"
	// 注册所有对象
	_ "gitee.com/lishixi/gops/vblog/apps"

	"github.com/infraboard/mcube/v2/ioc"
)

func LoadConfig() {
	// 配置单元单元测试的配置, application.toml
	req := ioc.NewLoadConfigRequest()
	req.ConfigFile.Enabled = true
	// 必须配置绝对路径, {Workspace}
	workspaceDir := os.Getenv("WORKSPACE_DIR")
	if workspaceDir == "" {
		req.ConfigFile.Path = "etc/application.toml"
	} else {
		req.ConfigFile.Path = workspaceDir + "/etc/application.toml"
	}

	err := ioc.ConfigIocObject(req)
	if err != nil {
		panic(err)
	}

}
